package IO;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream f1 = new FileInputStream("./test.png.jpeg");
        FileOutputStream f2=new FileOutputStream("./copy.png.jpeg");
        int i;
        long begin=System.currentTimeMillis();
        while((i=f1.read())!=-1)
        {
            f2.write(i);
        }
        long end=System.currentTimeMillis();
        System.out.println((double)end-(double)begin);
        f1.close();
        f2.close();
    }
}
